
#include <teresa\presenter.h>
#include <teresa\primitive.h>
#include <iostream>
#include <glfw\glfw3.h>
#include <regex>
#include <linear_algebra\linear_algebra.h>
#include <blu\fb_provider\glfw_win32.h>

void main_body()
{
	teresa::presenter presenter;

	teresa::primitive_semantic primsemantic;

	teresa::primitive_semantic_group geoattrs;
	geoattrs.push_back(teresa::predefined_semantic_postition_3d);
	geoattrs.push_back(teresa::predefined_semantic_normal_3d);
	geoattrs.push_back(teresa::predefined_semantic_texcoord_2d);
	primsemantic.insert(std::move(geoattrs));

	teresa::primitive_semantic_group animattrs;
	animattrs.push_back(teresa::predefined_semantic_joint_index);
	animattrs.push_back(teresa::predefined_semantic_joint_weight);
	primsemantic.insert(std::move(animattrs));

	teresa::primitive prim(presenter, primsemantic, 100);
}

int main()
{
	auto glfwStatus = glfwInit();
	if (glfwStatus != GLFW_TRUE)
	{
		std::cerr << "Cannot initialize GLFW.\n";
		return -1;
	}

	auto mainWindow = glfwCreateWindow(640, 480, "Bycicle not means car.", nullptr, nullptr);
	if (!mainWindow)
	{
		std::cerr << "Cannot create GLFW window.\n";
		glfwTerminate();
		return -1;
	}
	glfwMakeContextCurrent(mainWindow);

	win32_frame_buffer windowFrameBuffer(mainWindow);
	windowFrameBuffer.depth().value().clear(farest_depth);
	windowFrameBuffer.colors().front().clear();

	main_body();

	while (!glfwWindowShouldClose(mainWindow))
	{
		glfwPollEvents();
		// ...
	}
	glfwTerminate();

	return 0;
}